<div class="modal-dialog modal-md">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button"
                    class="close"
                    data-dismiss="modal"
                    aria-label="Close"
                    ng-click="closeThisDialog()" style="outline: none;"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">
                <span ng-show="new">新增物料</span>
            </h4>
        </div>
        <form role="form" ng-submit="submit()">
            <div class="modal-body">
                <div class="form-group">
                    <label for="product-new-name" class="control-label">物料名称</label>
                    <input type="text"
                           ng-focus="error.name=''"
                           class="form-control"
                           ng-model="product.name"
                           id="product-new-name"
                           placeholder="物料名称">
                    <span ng-show="error.name" class="label label-danger" ng-bind="error.name"></span>
                </div>
                <div class="form-group">
                    <label for="product-new-category_id"
                           class="control-label">物料分类</label>
                    <select class="form-control"
                            id="product-new-category_id"
                            ng-model="product.category_id"
                            ng-options="item.id as item.name for item in categories">
                    </select>
                    <span ng-show="error.category_id" class="label label-danger" ng-bind="error.category_id"></span>
                </div>
                <div class="form-group">
                    <label for="product-new-name" class="control-label">物料单位</label>
                    <input type="text"
                           ng-focus="error.unit=''"
                           class="form-control"
                           ng-model="product.unit"
                           id="product-new-unit"
                           placeholder="物料单位">
                    <span ng-show="error.unit" class="label label-danger" ng-bind="error.unit"></span>
                </div>
                <div class="form-group">
                    <label for="product-new-notes" class="control-label">备注信息</label>
                    <textarea ng-focus="error.notes=''"
                              class="form-control"
                              ng-model="product.notes"
                              id="product-new-notes"
                              rows="5"
                              placeholder="备注信息"></textarea>
                    <span ng-show="error.notes" class="label label-danger" ng-bind="error.notes"></span>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closeThisDialog()">关闭</button>
                <button type="submit" ladda="saveLoading" class="btn btn-primary">保存</button>
            </div>
        </form>
    </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->